package cn.example.thread;

/**
 * @author July
 * @description
 * @create 2025-09-01 10:17
 */
public class ThreadTest {

    private static void attack() {
        System.out.println("Fight");
        System.out.println("Current Thread is : " + Thread.currentThread().getName());
    }

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread() {
            @Override
            public void run() {
                attack();
            }
        };
        System.out.println("Current main thread is : " + Thread.currentThread().getName());
//        t.run();
        t.start();
        t.join();
        t.start();
    }
}
